<html>
<head>
<link href="../../Objects/sofa_white.css" rel="stylesheet" type="text/css" />
</head>
<body>
  <div id="contenu">		
    <center><h3>OdeSolver Tutorial</h3></center>

		<center>
		<table border="0">
		  <tr>
			<td><img src="ImplicitEuler_001.png" align="middle" width="200"></td>
			<td><img src="ImplicitEuler_002.png" align="middle" width="200"></td>
<!--			<td><img src="AdvancedResponseConstraintBased.png" align="middle" width="200"></td>-->
		  </tr>
		  <tr>
			<td align="center">Truth and initial cylinders</td>
			<td align="center">Simulation results</td>
<!--			<td align="center">Advanced Response</td>-->
		  </tr>
		</table> 
                </center>
		<br>
		<div id="orangeText">Description</div><br>

    <div align="left">
	In these tutorials, we show the different integration schemes and algorithms available to solve the system of Ordinary Differential Equations (ODE) at each step of the simulation.

        SOFA provides the following integration schemes:
        <ul>
          <li> Static integration scheme,</li>
          <li> Explicit integration schemes,</li>
          <li> Implicit integration schemes.</li>
        </ul>
	
      <p> Before going any further, it is important to know that state vectors in SOFA are saved in a component called "<b>State</b>" (see <i>chapter "State"</i> in the documentation).
      For instance, when mechanical models are being solved, the user needs to add a "MechanicalState" component in the graph.
      Inside the component, the format of storage for the state vector is a structure called <b>MultiVector</b>.
      The size and the nature of the degrees of freedom is chosen by setting a "template" in the State component. Let us now go into details about the different ODE solvers in SOFA.</p>

<br>
<ul>
      <li>
        <p>First, the <b>static</b> integration is an integration which does not take the time into account. Such a static integration can be useful for checking the convergence of algorithms.</p></li>
  </ul>
  <br>
      <p>Furthermore, different <b>dynamic</b> solvers have been implement in SOFA. Unlike static solvers, these solvers do take the dynamics of the system into account. However, depending on the aim of the computation, the solver has to be carefully chosen.
      Let us review the basic differences between explicit and implicit solvers.</p>
<center>
		<table border="0">
		  <tr>
			<td><img src="ExplicitFormula.bmp" align="middle" width="200"></td>
		  </tr>
		</table> 
</center>

<ul>
      <li>
        <p>Concerning the <b>explicit solvers</b>, they compute the new state variables from the state variables at the previous step.
      The advantage is that explicit solvers can be fast, but the stability of the solver is not always granted. Very small time steps can be required to get satisfactory accuracy.
      Moreover, such solvers are not suitable for every simulation. For example, explicit solvers do not compute cyclic loadings correctly, but could be advised in case of soft or high-mass objects.</p></li>
</ul>
<center>
		<table border="0">
		  <tr>
			<td><img src="ImplicitFormula.bmp" align="middle" width="400"></td>
		  </tr>
		</table> 
</center>
<ul>
      <li><p>Concerning <b>implicit solvers</b>, they compute the new state variables by solving an equation involving the previous state variables and the new ones.
      In contrast, implicit solvers are very stable (without conditions on the time step) and therefore work with larger time steps. The drawback of such a method is that it is more time consuming.
      For example, implicit solvers would be advised for stiff or low-mass objects.</p></li>

      <li>
        <p>Finally, it must be pointed out that explicit and implicit solvers are not the only way to solve ODEs.
      Some other solvers do exist, such as <b>semi-implicit</b> (also called explicit-implicit solvers) solvers. Such solvers solve a part of the equation explicitly and the other part implicitly.
      With such solvers using data from different steps, the user may face the need to save some state vectors during several time steps.
      More details about the implementation of these solvers are given in the documentation: <i>chapter "State"</i>, and <i>chapter "Solvers"</i>.</p></li>


</ul>


    </div>
  </div>
</body>
</html>
